@echo off
SET scriptPath=%CD:~0,-6%
IF "%scriptPath%script"=="%CD%" (SET isDevMode=1) ELSE (set isDevMode=2)
IF %isDevMode%==1 goto devMode
IF %isDevMode%==2 goto pubMode
:devMode

echo #### Run the application in Development Mode ####  
echo #### Run sync codes in Development Mode ####  
 #svn update  #should be use git pull command.

echo #### Clean and Build application in Development Mode ####  
CD %scriptPath%..  
mvn clean compile package  && start /wait /b java -cp "target/root/lib/*;target/root/classes" bootstrap.Main -r 0
goto end

:pubMode
echo #### Run the application in Publishment Mode #### 
echo java -Xms128m -Xmx1024m -XX:MaxPermSize=256m -jar rsf-server.jar
java -Xms128m -Xmx1024m -XX:MaxPermSize=256m -jar rsf-server.jar

:end
echo ####  End~ #### 